package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.igas.bomp.facade.BompMchntManageService;
import cc.rengu.igas.bomp.facade.BompMchntQueryService;
import cc.rengu.igas.bomp.facade.bean.ImportMchntInfoBean;
import cc.rengu.igas.bomp.facade.bean.ManagerInfoBean;
import cc.rengu.igas.bomp.facade.bean.MchntInfoBean;
import cc.rengu.igas.bomp.facade.request.*;
import cc.rengu.igas.bomp.facade.response.*;
import cc.rengu.redp.bizimpl.enums.BompQueryTypeEnum;
import cc.rengu.redp.bizimpl.enums.DBCharsetEnum;
import cc.rengu.redp.bizimpl.igas.vo.OnlineVerificationVO;
import cc.rengu.redp.bizimpl.igas.vo.SettleAcctInfoVO;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpBMchntBaseInfo;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpBMchntFeeInfo;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpBMchntSignInfo;
import cc.rengu.redp.bizimpl.upmp.vo.*;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.poi.ss.usermodel.Sheet;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 刘玉亮.LL
 * @since 2021-06-22
 */
public interface IUpmpBMchntBaseInfoService extends IService<UpmpBMchntBaseInfo> {

    String getOprMenuId();

    String getOprMenuName();

    String getWebNextUrl();

    String getOprBtnNamePrefix();

    String genMerOrder(String instid);

    List<UpmpBMchntBaseInfo> getBMchntBaseInfoByGroupMchntNo(String groupMchntNo);

    UpmpBMchntBaseInfo findByMchntNo(String mchntNo);

    String selectByMchntNo(String mchntNo);

    IPage<MchntInfoBean> findByPage(QueryRequest request, UpmpBMchntBaseInfo info) throws RedpException;

    UpmpBMchntBaseInfo editTabs(UpmpBMchntBaseInfo entity) throws RedpException;

    Map<String, Object> editShow(UpmpBMchntBaseInfo info) throws RedpException;

    ParamQueryResponse paramQuery(String instId, ParamQueryRequest req, String traceNo) throws RedpException;

    Map<String, Object> editSave(UpmpBMchntBaseInfo entity) throws RedpException;

    Map<String, Object> signInfoShow(String instId, String mchntNo, String optFlag) throws RedpException;

    Map<String, Object> signInfoSave(UpmpBMchntSignInfo entity) throws RedpException;

    Map<String, Object> editMchntImage(String instId, String mchntNo, String optFlag) throws RedpException;

    OperationResult mchntImageSave(MchntImageManageVO entity) throws RedpException;

    OperationResult mchntAcctSave(MchntSettleInfoManageVO entity) throws RedpException;

    Map<String, Object> mchntAcctShow(String instId, String mchntNo, String optFlag) throws RedpException;

    abstract Map<String, Object> mchntProdShow(String instId, String mchntNo, String mchntName, String optFlag) throws RedpException;

    OperationResult mchntProdSave(MchntProdManagerVO entity) throws RedpException;

    Map<String, Object> mchntProdDtlShow(MchntProdUnitedFeeVO entity, String view) throws RedpException;

    OperationResult mchntProdDtlSave(MchntProdManagerVO entity) throws RedpException;

    OperationResult acctAuth(SettleAcctInfoVO entity) throws RedpException;

    Map<String, Object> openCashOut(UpmpBMchntBaseInfo entity) throws RedpException;

    OperationResult getreqD0(String instId, String mchntNo) throws RedpException;

    OperationResult openCashOutSave(@Valid UpmpBMchntFeeInfo entity) throws RedpException;

    OperationResult creditReport(OnlineVerificationVO entity) throws RedpException;

    OcrResponse ocrService(String instId, UpmpUserInfoVO user, OcrRequest req, String traceNo) throws RedpException;

    OperationResult onlineVerification(@Valid OnlineVerificationVO entity) throws RedpException;

    OperationResult thirdEntry(@Valid InstMchntRegisterVO entity, String opr) throws RedpException;

    OperationResult thirdEntry(String instId, InstMchntRegisterRequest req, String traceNo);

    OperationResult thirdEntryQuery(String instId, InstMchntQueryRequest req, String traceNo);

    OperationResult cancelQuery(String instId, String mchntNo) throws RedpException;

    OperationResult instMchntBlacklist(String instId, String mchntNo, String mchntName) throws RedpException;

    OperationResult accSign(String instId,
                            String acctNo, String mchntNo) throws RedpException;

    OperationResult mchntType(String instId, String optFlag,
                              String mchntNo, String refuseReason) throws RedpException;

    UpmpBMchntBaseInfo queryMchntNo(String instId, String mchntNo);


    Map<String, Object> agentMchntSelect2List(String instId,String agentMchntNo, QueryRequest request) throws RedpException;

    Map<String, Object> industryInfoSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> mchntAreaSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> mchntLevelSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> platMchntSelect2List(String q, QueryRequest request) throws RedpException;

    Map newMchntCount(String userId);

    Map<String, Object> groupMchntSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> bankNameCodeQuerySelect2List(String q, QueryRequest request) throws RedpException;

    IPage<UpmpBMchntBaseInfo> mchntFormalSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> feeTemplateSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> cupsmchntSelect2List(String q, QueryRequest request) throws RedpException;

    Map<String, Object> registerselect2(String q, QueryRequest request) throws RedpException;

    Map<String, Object> managerInfoSelect2List(String q, QueryRequest request) throws RedpException;

    Page<ManagerInfoBean> managerInfoList(QueryRequest request, String instId, String managerName, String roleType, String signInstType, String orgCode);


    IPage<UpmpBMchntBaseInfo> chainMchntNoSelect2List(QueryRequest request, String q);

    List<UpmpBMchntBaseInfo> getBMchntBaseInfoByMchntLevel(String mchntLevel);


    OperationResult imageFileUpDownload(String instId, ImageFileUpDownloadRequest req, BompMchntManageService bompMchntManageService,
                                        String traceNo, String type) throws RedpException;

    StringBuffer analysisExcel(Sheet sheet1, Sheet sheet2, Sheet sheet3, int maxRecords, DBCharsetEnum dbCharsetEnum, List<ImportMchntInfoBean> mchntList) throws RedpException, RedpException;


    OperationResult mchntBatchImport(String instId, MchntBatchImportRequest req,
                                     String traceNo) throws RedpException;

    HashMap<String, Object> exportFromBomp(HttpServletRequest request, String instId, UpmpUserInfoVO user, String traceNo, int pageIndex, int pageSize);

    List<UpmpBMchntBaseInfo> getByInstId(String instId);

    MchntBaseInfoQueryResponse mchntBaseInfoQuery(String instId, UpmpUserInfoVO user, BompMchntQueryService bompMchntQueryService, String genMerOrder, String mchntNo, String mchntName, BompQueryTypeEnum real) throws RedpException;

    IPage<UpmpBMchntBaseInfo> selectByPage(QueryRequest request, UpmpBMchntBaseInfo entity);

    void editOrRelease(UpmpBMchntBaseInfo entity) throws RedpException;

    OperationResult wechatRealNameApply(UpmpUserInfoVO user, HttpServletRequest request, String traceNo);

    OperationResult wechatRealNameApplyCancel(UpmpUserInfoVO user, HttpServletRequest request, String traceNo);

    OperationResult wechatRealNameAuditQuery(UpmpUserInfoVO user, HttpServletRequest request, String traceNo);

    List<UpmpBMchntBaseInfo> getMarchantInfoByLevel(String mchntLevel);

    Map<String, Object> findMchntBaseInfoListByName(QueryRequest request, UpmpBMchntBaseInfo upmp);

    Map<String, Object> mchntBaseInfoListByNo(QueryRequest request, String q);

    UpmpBMchntBaseInfo getMarchantInfoByMcNo(String instId, String mcNo);

    MchntInfoListQueryResponse mchntInfoListQuery(String instId, UpmpUserInfoVO user, MchntInfoListQueryRequest req, String traceNo) throws RedpException;

    MchntAreaListQueryResponse mchntAreaListQuery(String instId, UpmpUserInfoVO user, MchntAreaListQueryRequest req, BompMchntQueryService bompQueryService, String traceNo) throws RedpException;

}

